$executingScriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
. "$executingScriptDir\PsUtils.ps1"

Get-ChildItem "$pathSource\**\VersionInfo.txt" -Recurse | ForEach-Object {
	$currentDir = (Get-Item $_).Directory
	
	$versionInfo = Load-Settings($_)
	$major = $versionInfo.Major
	$minor = $versionInfo.Minor
	$days = [System.DateTime]::Now.Subtract([System.DateTime]::Parse($versionInfo.StartDate)).Days
	
	Get-ChildItem $currentDir -Filter "AssemblyInfo.cs" -Recurse | ForEach-Object {
		$file = $_.FullName
		(Get-Content $file) | 
			ForEach-Object {[Regex]::Replace($_, '\d+\.\d+\.\d+\.[\d*]+', "${major}.${minor}.${days}.*")} | 
			Set-Content $file
	}
} 
